// SpwlPersist.cpp: implementation of the SpwlPersist class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "SpwlPersist.h"
#include "Spwl.h"
#include "DatabaseBase.h"
#include "DatabaseElement.h"
#include "SPWLTable.h"
#include "Spec.h"
#include "SpecPersist.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

using namespace PDMS::SpecFrame;

namespace PDMS
{
	namespace PDMSDBIF
	{
		BEGIN_REGISTER_MAP( SpwlPersist, PersistRegBase )
		REGISTER( UE_RUNTIME_CLASS( Spwl ), GET_REGISTER( PersistRegBase, VersionOne ) )
		END_REGISTER_MAP();
		
		SpwlPersist::SpwlPersist()
		{

		}

		SpwlPersist::~SpwlPersist()
		{

		}

		UESoft::ErrorStatus SpwlPersist::Retrieve( Persistable*& pObj )
		{	
			return ReadPaternity( pObj );
		}

		UESoft::ErrorStatus SpwlPersist::Create( Persistable* pObj )
		{
			return CreatePaternity( pObj );
			/*(DatabaseBase* pBase = this->GetDatabase();
			ASSERT( pBase );

			DatabaseElement* pElement = pBase->GetDatabaseElement( _T("SPWL") );
			ASSERT( pElement );

			ASSERT( pElement->IsKindOf( UE_RUNTIME_CLASS( SPWLTable ) ) );
			SPWLTable* pSPWLTable = static_cast<SPWLTable*>( pElement );

			ASSERT( pObj->IsKindOf( UE_RUNTIME_CLASS( Spwl ) ) );
			Spwl* pSpwl = static_cast< Spwl* >( pObj );
			
			pSPWLTable->Open();
			pSPWLTable->NewRecord();
			pSPWLTable->SetID( pSpwl->Id().ObjectID() );
			pSPWLTable->SetSpecName( pSpwl->Name() );
			*/
			return UESoft::eOk;
		}

		UESoft::ErrorStatus SpwlPersist::Update( Persistable* pObj )
		{
			return UESoft::eOk;
		}
	}
}


